Skip to main content

v8.0.0

Breaking Changes

Model Configuration Methods — Renamed

Model configuration uses declarative methods inside the cm_admin do block. Pass a value to configure an option; calling the same method without an argument returns its current value.

BeforeAfter
set_icon 'fa fa-file'icon_name 'fa fa-file'
set_display_name 'Blog Post'display_name 'Blog Post'
set_policy_scopes [...]policy_scopes [...]
set_default_scope [...]default_scopes [...]
self.comments_tab = {...}comments_tab mentions_model: User
visible_on_sidebar falsevisible_on_sidebar false
permit_additional_fields [...]additional_permitted_fields [...]
override_pundit_policy trueoverride_policy true
self.mcp_enabled = truemcp_enabled true
self.description = '...'description '...'
self.global_search_fields = ...global_search_fields [...]

Standard Ruby assignment remains available for programmatic configuration outside the DSL, for example model.icon_name = 'fa fa-file'.

Internal Method Renames

These are internal changes. If you were reading these values directly, update references:

BeforeAfter
model.is_visible_on_sidebarmodel.visible_on_sidebar
model.mcp_action_listmodel.available_mcp_actions
note

The mcp_actions DSL method (used inside cm_admin do blocks) is unchanged. Only the internal reader was renamed.

Sort Configuration — Use sort for Each Column

The sortable_columns, sort_column, and sort_direction methods have been removed. Define each sortable column with a separate sort call instead.

# Before
sortable_columns [
{ column: 'name', display_name: 'Name' },
{ column: 'created_at', display_name: 'Created At', default: true, default_direction: 'desc' },
{ column: 'metadata_updated_at', display_name: 'Metadata Updated At', sort_datatype: 'TIMESTAMP' }
]

# After
sort column: 'name', display_name: 'Name'
sort column: 'created_at', display_name: 'Created At', default: true, default_direction: 'desc'
sort column: 'metadata_updated_at', display_name: 'Metadata Updated At', datatype: 'TIMESTAMP'

The sort_datatype option has also been renamed to datatype.

If you previously configured the default sort separately, combine it into one sort declaration:

# Before
sort_column :created_at
sort_direction :desc

# After
sort column: 'created_at', default: true, default_direction: 'desc'
warning

Sort query parameters now use the nested sort[column][dir] format to support multiple sort columns. Update any saved URLs or integrations that construct the old sort_column, sort_direction, or sort_datatype parameters.

Tag Fields Renamed to Badge Fields

The :tag field type and tag_class option have been renamed to :badge and badge_class. Update both index columns and show-page fields.

# Before
column :status, field_type: :tag, tag_class: { approved: 'cm-badge-green', draft: 'cm-badge-yellow' }
field :status, field_type: :tag, tag_class: { approved: 'cm-badge-green', draft: 'cm-badge-yellow' }

# After
column :status, field_type: :badge, badge_class: { approved: 'cm-badge-green', draft: 'cm-badge-yellow' }
field :status, field_type: :badge, badge_class: { approved: 'cm-badge-green', draft: 'cm-badge-yellow' }

The supported CSS class names remain cm-badge-blue, cm-badge-yellow, cm-badge-orange, cm-badge-purple, cm-badge-cyan, cm-badge-green, cm-badge-gray, and cm-badge-red.

Migration Steps

  1. Update all model concern files. Here is a before/after example:
# Before
cm_admin do
actions except: %i[import]
set_display_name 'Cron Job'
set_icon 'fa-regular fa-clock'
visible_on_sidebar false
set_policy_scopes [{ scope_name: 'by_current_user', display_name: 'User Only' }]
permit_additional_fields [category_ids: []]
end

# After
cm_admin do
actions except: %i[import]
display_name 'Cron Job'
icon_name 'fa-regular fa-clock'
visible_on_sidebar false
policy_scopes [{ scope_name: 'by_current_user', display_name: 'User Only' }]
additional_permitted_fields [category_ids: []]
end
  1. Replace sortable_columns, sort_column, and sort_direction with one sort declaration per sortable column
  2. Replace sort_datatype with datatype and update integrations that construct sort query parameters
  3. Replace field_type: :tag with field_type: :badge and tag_class with badge_class
  4. If you reference is_visible_on_sidebar or mcp_action_list anywhere in your app, update those to visible_on_sidebar and available_mcp_actions

Migration Template File Extensions

All migration template files in generators have been renamed from .rb to .tt extensions to follow Rails conventions.

Impact:

  • This change only affects generator templates, not existing migrations
  • No action required for existing applications